package dynamicproxy.jdk;

import staticproxy.service.PerSonService;
import staticproxy.service.PersonServiceImpl;

/**
 * @Author liangbaigao
 * @Date 2023/9/29 22:52
 */
public class Client {


    public static void main(String[] args) {
        PerSonService target = new PersonServiceImpl();
        //System.out.println(target.getClass());
        System.out.println("原目标正在调用");
        target.speak();
        System.out.println();
        PerSonService jdkProxy = (PerSonService) new JdkProxy(target).getJdkProxy();
        //System.out.println(jdkProxy.getClass());
        System.out.println("jdk代理目标正在调用");
        jdkProxy.speak();
        while (true) {}
    }
}
